package cinema.model;

import cinema.service.*;
import cinema.util.*;

public class ManagerUser extends User {
    public ManagerUser(String id, String username, String password, String phone) {
        super(id, username, password, UserType.MANAGER, phone);
    }

    @Override
    public void showMenu() {
        while (true) {
            System.out.println("\n===经理菜单===");
            System.out.println("1. 影片管理 2. 排片管理 3. 销售数据 4. 修改密码 5. 退出");
            switch (InputUtil.readInt("请选择: ")) {
                case 1 -> MovieService.manageMovies();
                case 2 -> ShowtimeService.manageShowtimes(this);
                case 3 -> TicketService.showSaleData();
                case 4 -> {
                    changePassword(InputUtil.readLine("新密码: "));
                    Logger.log("经理修改密码", username);
                }
                case 5 -> { return; }
            }
        }
    }
}